{{set . "title" "管理分类"}}
{{append . "moreStyles" "css/admin/admin-category.css"}}
{{append . "moreScripts" "js/admin/admin-category.js"}}
{{template "Layout/AdminHeader.html" .}}

<div class="main admin-user">
  <h2 class="page-header title">{{.title}}</h2>
      <div class="sub-opration">
        <button class="btn btn-primary btn-sm" 
         onclick="javascript:location.href='/admin/category/add'">新增
        </button>  
    </div>
  <div>
      {{if gt (len .categorys) 0}}
        <div class="table-div">
            <table class="table">
                <thead>
                    <th>ID</th>
                    <th>标签名</th>
                    <th>Ident</th>
                    <!--<th>文章数</th>-->
                    <th>修改</th>
                    <th>删除</th>
                </thead>
                <tbody>
                    {{range .categorys}}
                    <tr id="category-col-{{.Id}}">
                        <td>{{.Id}}</td>
                        <td>{{.Name}}</td>
                        <td>{{.Ident}}</td>
                        <!--<td>{{/*.RelatedBlogCount*/}}</td>-->
                        <td><a href="/admin/category/edit/{{.Id}}">修改</a></td>
                        <td><a href="javascript:void(0)" onclick="CategoryArea.del({{.Id}})">删除</a></td>
                    </tr>
                    {{end}}
                </tbody>
            </table>
        </div>
      {{else}}
        没有分类
      {{end}}
  </div>
</div>  

{{template "Layout/AdminFooter.html" .}}